package cn.fintecher.gis.entity;

import cn.fintecher.gis.enums.CommonShow;
import cn.fintecher.gis.enums.PatrolStatus;
import cn.fintecher.gis.enums.PatrolType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "patrol_info")
@Data
@ApiModel(value = "patrol_info", description = "巡查信息")
public class PatrolInfo extends BaseEntity {
    @ApiModelProperty(notes = "任务名称")
    private String name;

    @ApiModelProperty(notes = "任务备注")
    private String remark;

    @ApiModelProperty(notes = "计划时间")
    private Date planTime;

    @ApiModelProperty(value = "巡查信息")
    private String content;

    @ApiModelProperty(notes = "任务区域")
    private String region;

    @ApiModelProperty(notes = "任务地址")
    private String site;

    @ApiModelProperty(notes = "位置x")
    private Double positionX;

    @ApiModelProperty(notes = "位置y")
    private Double positionY;

    @ApiModelProperty(notes = "巡查人员")
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "user_id")
    private Operator operator;

    @ApiModelProperty(notes = "巡查状态")
    @Enumerated(EnumType.STRING)
    private PatrolStatus status;

    @ApiModelProperty(notes = "巡查类型")
    @Enumerated(EnumType.STRING)
    private PatrolType type;

    @ApiModelProperty(notes = "创建时间")
    private Date createTime;

    @ApiModelProperty(notes = "是否上传图片")
    @Enumerated(EnumType.STRING)
    private CommonShow image;

    @ApiModelProperty(notes = "是否上传视频")
    @Enumerated(EnumType.STRING)
    private CommonShow video;

    @ApiModelProperty(notes = "是否采集数据")
    @Enumerated(EnumType.STRING)
    private CommonShow collectData;

    @ApiModelProperty(notes = "创建人")
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "create_user")
    private Operator createOperator;
}
